
module AM_Demodulator
#(
    parameter WIDTH = 10,
    parameter MAXINTERVAL_WIDTH = 8
)
(
    input wire signed [WIDTH-1:0] i_AM_Signal,
    input wire [MAXINTERVAL_WIDTH-1:0] i_Interval,
    input wire i_clk,
    input wire i_rst,
    output wire signed [WIDTH-1:0] o_Baseband
);

Envelope_Detector_Digital 
#(
    .WIDTH(WIDTH),
    .MAXINTERVAL(64),
    .MAXINTERVAL_WIDTH(MAXINTERVAL_WIDTH)
)
ED_AM
(
    .i_SignalInput(i_AM_Signal),
    .i_Interval(i_Interval),
    .i_clk(i_clk),
    .i_rst(i_rst),
    .o_Envelope(o_Baseband)
);

endmodule